<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="head.jsp" %>
<meta charset="utf-8">
<div class="container">
	<div class="row clearfix">
	<div class="col-md-12 column">
			<div class="page-header">
				<h1>
					老司机视频区
				</h1>
			</div>
			<c:forEach items="${videos }" var="info">
				<div class="form-group">
					<p class="bg-info">
	   					${info.title }
	   				</p>
					<video width="320" height="240" controls><source src="${info.videoSrc }" type="video/mp4">
					</video>
				</div>
			</c:forEach>
	</div>
</div>
</div>
<input type="hidden" id="pathId" value="<%=request.getContextPath() %>">
<script>
$(".addLove").click(function(){
	var userName=$("#userName").val();
	var content=$("#content").val();
	if(userName==""){
		alert("昵称不能为空");
		return;
	}
	if(content==""){
		alert("内容不能为空");
		return;
	}
	$.ajax({ 
		   type: "post", 
		   url: $("#pathId").val()+"/love/addLoveShow",
		   data: {"nickname":userName,"content":content},
		   cache:false, 
		   async:false, 
		   success: function(xmlobj){ 
			   window.location.reload()
			 /* //添加数据到 table 第一行
			 var html="<tr><td></td><td></td><td></td></tr>";
		     $("#tbScanData").prepend(row); */
		   } 

		});
});
</script>